package com.example.idie.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.idie.bean.Dataset;
import com.example.idie.bean.Model;
import com.example.idie.bean.Response;
import com.example.idie.mapper.DatasetInfoMapper;
import com.example.idie.mapper.ModelInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class InfoServiceImpl implements InfoService{
    @Resource
    private ModelInfoMapper modelInfoMapper;

    @Resource
    private DatasetInfoMapper datasetInfoMapper;

    @Override
    public Response getModelInfos() {
        QueryWrapper queryWrapper = new QueryWrapper();
        List<Model> models = modelInfoMapper.selectList(queryWrapper);

        //System.out.println(models);

        return Response.success(models);
    }

    @Override
    public Response getDatasetInfos() {
        QueryWrapper queryWrapper = new QueryWrapper();
        List<Dataset> datasets = datasetInfoMapper.selectList(queryWrapper);

        //System.out.println(datasets);

        return Response.success(datasets);
    }
}
